#include <stdio.h>
#include <math.h>

int test_array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};

double array_average(int *ptr, int len)
{
    double sum = 0;
    for (int i = 0; i < len; i++)
    {
        sum += ptr[i];
    }

    return sum / len;
}

int main(int argc, char *argv[])
{
    printf("average is %f\r\n", array_average(test_array, 10));

    return 0;
}
